package com.alageek.study.controller;

import com.alageek.study.entity.Employee;
import com.alageek.study.entity.ResultEntity;
import com.alageek.study.service.EmployeeRemoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class EmployeeFeignHandler {
    @Autowired
    private EmployeeRemoteService service;

    @RequestMapping("/feign/consumer/get/emp")
    public Employee getEmployeeRemote(){
        return service.getEmployeeRemote();
    }

    @RequestMapping("/feign/consumer/circuit/breaker/get/emp")
    public ResultEntity<Employee> getEmpRemote(@RequestParam("signal") String signal){
        return service.getEmpRemote(signal);
    }
}
